home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1996, 1997 Meta Four Software. All rights reserved.
- //
- // Display server sample code
- //
- //! rev="$Id: mydlg.h,v 1.3 1997/05/27 00:06:24 jcw Rel $"
-
- /////////////////////////////////////////////////////////////////////////////
-
- class CServer : public CSocket
- {
- public:
- typedef void (*ConnectHandler)(CFile&);
-
- CServer (int port_, ConnectHandler handler_);
- ~CServer ();
-
- virtual void OnAccept(int error_);
- virtual void OnClose(int error_);
-
- private:
- int _port;
- ConnectHandler _handler; // called when a new connection is opened
- };
-
- // CMyDlg dialog
-
- class CMyDlg : public CDialog
- {
- // Construction
- public:
- CMyDlg (CWnd* pParent = NULL); // standard constructor
- ~CMyDlg ();
-
- // Dialog Data
- //{{AFX_DATA(CMyDlg)
- enum { IDD = IDD_CATRECV_DIALOG };
- CEdit m_port;
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
- // Implementation
- protected:
- int _timer;
- CServer* _server;
-
- // Generated message map functions
- //{{AFX_MSG(CMyDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnChangePort();
- afx_msg void OnTimer(UINT nIDEvent);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
- /////////////////////////////////////////////////////////////////////////////
-